//
//  AddressInfoModel.swift
//  DragonWallet
//
//  Created by volantPig on 2024/7/29.
//

import UIKit
import ObjectMapper

class AddressInfoModel: NSObject, Mappable {

    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        
    }
}

class ProvinceModel: AddressInfoModel {
    var provinceName: String?
    var provinceCode: String?
    var cityArray: [CityModel]?
    
    required init?(map: Map) {
       super.init(map: map)
    }
    
    override func mapping(map: Map) {
        provinceName <- map["v"]
        provinceCode <- map["k"]
        cityArray    <- map["n"]
    }
}


class CityModel: AddressInfoModel {
    var cityName: String?
    var cityCode: String?
    var areaArray: [AreaModel]?
    required init?(map: Map) {
        super.init(map: map)
    }
    
    override func mapping(map: Map) {
        cityName    <- map["v"]
        cityCode    <- map["k"]
        areaArray   <- map["n"]
    }
}

class AreaModel: AddressInfoModel {
    var areaName: String?
    var areaCode: String?
    
    required init?(map: Map) {
        super.init(map: map)
    }
    
    override func mapping(map: Map) {
        areaName    <- map["v"]
        areaCode    <- map["k"]
    }
}

